﻿<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>Hoá đơn bán hàng</title>

	<style type="text/css">

	::selection{ background-color: #E13300; color: white; }
	::moz-selection{ background-color: #E13300; color: white; }
	::webkit-selection{ background-color: #E13300; color: white; }

	body {
		background-color: #fff;
		margin: 40px;
		font: 13px/20px normal Helvetica, Arial, sans-serif;
		color: #4F5155;
	}

	a {
		color: #003399;
		background-color: transparent;
		font-weight: normal;
	}

	h1 {
		color: #444;
		background-color: transparent;
		border-bottom: 1px solid #D0D0D0;
		font-size: 19px;
		font-weight: normal;
		margin: 0 0 14px 0;
		padding: 14px 15px 10px 15px;
	}

	#body{
		margin: 0 15px 0 15px;
	}

	p.footer{
		text-align: right;
		font-size: 11px;
		border-top: 1px solid #D0D0D0;
		line-height: 32px;
		padding: 0 10px 0 10px;
		margin: 20px 0 0 0;
	}

	#container{
		margin: 10px;
		border: 1px solid #D0D0D0;
		-webkit-box-shadow: 0 0 8px #D0D0D0;
	}

	.title{
		font-size: 1.3em;
	}
	.left{
		font-weight: bold;
		font-size: 1.1em;
	}

	.left span{
		float: right;
		width: 770px;
		font-weight: normal!important;
	}

	th{
		background-color: #333;
		color: #fff;
		padding: 7px;
		border: none!inportant;
	}

	td{
		text-align: center!important;
		border-bottom: 1px solid #ccc;
		border-left: 1px solid #ccc;
		border-right: 1px solid #ccc;
		padding: 7px;
	}
	</style>
</head>
<body>

<div id="container">
	<h1>Hoá đơn bán hàng, ngày <?=date('d-m-Y', strtotime($order->order_date))?></h1>

	<div id="body">
		<h3 class="title">Thông tin khách hàng</h3>
		<p class="left">Họ và tên: <span><?=$order->customer_name?>.</span></p>
		<p class="left">Địa chỉ : <span><?=$order->customer_address?>.<span></p>
		<p class="left">Email: <span><a style="color: #00A6DD;" href="mailto:<?=$order->customer_email?>"><?=$order->customer_email?></a></span></p>
		<p class="left">Điện thoại: <span><?=$order->customer_phone?></span></p>

		<h1></h1>
		<h3 class="title">Phí vận chuyển</h3>
		<p><strong><?=number_format($order->order_ship,0,",",".")?></strong> đ</p>
		<h3 class="title">Thời gian đặt hàng</h3>
		<p><?=$order->order_date?></p>

		<h1></h1>

		<h3 class="title">Chi tiết hoá đơn</h3>

		<div id="table">
			<table style="width:100%">
				<thead>
					<tr>
						<th>Số lượng</th>
						<th>Tên sản phẩm</th>
						<th>Giá</th>
						<th>Thành tiền</th>
					</tr>
				</thead>

				<tbody>
					<?php foreach($order_items as $item):?>
					<tr>
                        <td><?=$item->quantity?></td>
                        <td><?=$item->product_name?></td>
                        <td><?=number_format($item->price,0,",",".")?> đ</td>
                        <td><?=number_format($item->price*$item->quantity,0,",",".")?> đ</td>
                    </tr>
                    <?php endforeach;?>
                    <tr class="self">
                        <td style="text-align: right!important;padding-right: 36px!important;" colspan="3">Tổng thành tiền</td>
                        <td colspan="1"><?=number_format($order->total,0,",",".")?> đ</td>
                    </tr>
                    <tr class="self">
                        <td style="text-align: right!important;padding-right: 36px!important;" colspan="3">Phí vận chuyển</td>
                        <td colspan="1"><strong><?=number_format($order->order_ship,0,",",".")?></strong> đ</td>
                    </tr>

                    <tr class="self">
                        <td style="text-align: right!important;padding-right: 36px!important;" colspan="3"><strong>Thành tiền</strong></td>
                        <td colspan="1"><strong>
							<?php if($order->order_total != 0):?>
								<?=number_format($order->order_total,0,",",".")?> đ
							<?php else:?>
								<?=number_format($order->total,0,",",".")?> đ
							<?php endif;?>
						</strong></td>
                    </tr>
				<tbody>
			</table>
		</div>

	</div>
	<p class="footer">Website: <strong><a href="<?=base_url()?>">Jewel.com<a></strong></p>
</div>

</body>
</html>